The present invention relates to a video encoder and a method of operating the same. More particularly, the present invention relates to a technology effective for implementing high-precision bit rate control.
A common moving picture compression method compliant with MPEG-2, which is standardized by the ISO/IEC 13818-2 international standard, is based on a principle in which a video storage capacity and a required bandwidth are reduced by deleting redundant information from a video stream. MPEG is an acronym for Moving Picture Experts Group.
The MPEG-2 standard merely defines the syntax (rules on a compression-encoded data stream or a method of configuring an encoded data bit stream) and decoding process of a bit stream. Therefore, the MPEG-2 standard is flexible enough to be fully usable in various services such as satellite broadcast, cable television, interactive television, and the Internet.
In an MPEG-2 coding process, a video signal is subjected to a sampling process and then to a quantization process in order to initially define the color and luminance components of each pixel of digital video. Values indicative of the color and luminance components are stored in a structure known as a macroblock. The values indicative of the color and luminance components, which are stored in the macroblock, are converted to frequency values by discrete cosine transform (DCT). Frequency conversion coefficients of the luminance and color of a picture, which are derived from DCT, are different in frequency. A quantized DCT coefficient is encoded by a variable-length coding (VLC) method that further compresses a video stream.
For the MPEG-2 coding process, additional compression provided by a motion compression technology is defined. According to the MPEG-2 standard, three different pictures or frames, namely, an I-frame, a P-frame, and a B-frame, exist. The I-frame is an intra-coded frame that is reproduced without referencing any other picture or frame in a video stream. The P-frame and the B-frame are inter-coded frames that are reproduced by referencing another picture or frame. For example, the P-frame and the B-frame each include a motion vector that indicates an estimated motion of a referenced frame. The use of the motion vector enables an MPEG encoder to reduce the bandwidth required for a specific video stream. The I-frame, the P-frame, and the B-frame are called an intra-coded frame, a predictive-coded frame, and a bidirectionally predictive-coded frame, respectively.
Consequently, an MPEG-2 compliant video encoder includes an encoder memory, a motion vector detector, a motion compensator, a subtractor, a DCT section, a quantizer, an inverse quantizer, an inverse DCT section, a frame memory, a variable-length coding section, and an adder. Video input signals are stored in the encoder memory for B-frame encoding and motion vector detection purposes, and then read from the frame memory in the order of encoding. In the subtractor, motion-compensated prediction signals generated by the motion compensator are subtracted from the read video input signals. As regards a predictive residual, which is the result of subtraction, the DCT section and the quantizer perform a DCT process and a quantization process, respectively. A quantized DCT coefficient is not only subjected to a variable-length coding process in the variable-length coding section, but also subjected to a local decoding process in the inverse quantizer and in the inverse DCT section. The result of the local decoding process is supplied to the adder through the frame memory and the motion compensator.
Meanwhile, an MPEG-2 compliant video decoder includes a buffer memory, a variable-length decoding section, an inverse quantizer, an inverse DCT section, a motion compensator, an adder, and a frame memory. An MPEG-2 compliant encoded bit stream is stored in the buffer memory, and then subjected to a variable-length decoding process, an inverse quantization process, and an inverse DCT process, which are performed by the variable-length decoding section, the inverse quantizer, and the inverse DCT section, respectively. As a result, a predictive residual is generated. The adder adds the predictive residual to a reference image that is read from the frame memory in accordance with the motion vector generated during the variable-length coding process. A reproduced image signal is then generated from the output of the adder. The reproduced image signal is stored in the frame memory and used as a reference image for predicting another frame.
According to “Digital Consumer Electronics Handbook, Chapter on MPEG-1 and MPEG-2 Digital Coding Standards, McGraw-Hill, 1997”, which is written by T. Sikora, the quantization step size of a quantizer of an encoder is adjusted to achieve a code amount (bit rate) for avoiding the overflow and underflow of a buffer memory of a decoder when the encoder generates a bit stream that is to be supplied to the decoder's buffer memory. For the purpose of making such an adjustment, as described in “Complete Understanding of JPEG and MPEG, pp. 144-153, Koronasha, Jul. 30, 2006, First Edition, Second Issue”, which is written by Seiichiro Hangai and Kenji Sugiyama, a virtual video buffer (VB) is supposed to be disposed between a buffer for storing the output of a variable-length coding section of the encoder and the input of the decoder's buffer memory so that the virtual video buffer (VB) exercises feedback control over a quantization control section for adjusting the quantization step size of the encoder's quantizer. In other words, “Complete Understanding of JPEG and MPEG, pp. 144-153, Koronasha, Jul. 30, 2006, First Edition, Second Issue” describes bit rate control of a quantization scale in a quantizer for MPEG coding control called “Test Model 5” that is exercised to provide feedback control of the quantization scale of the encoder's quantizer in accordance with the fill rate of a virtual buffer, which is the ratio of an actual code amount to a target code amount.
A video encoder for performing an entropy coding (variable-length coding) process based on context-adaptive binary arithmetic coding (CABAC) that is compliant with MPEG-4 AVC (H. 264), which is standardized by the ISO/IEC 14496-10 international standard, is shown in FIG. 1 of Japanese Unexamined Patent Application Publication No. 2009-055384. The video encoder includes a predictive coding section, an arithmetic coding section, and a buffer. After the predictive coding section encodes a video input signal by using a predicted value, the arithmetic coding section generates encoded data by subjecting each syntax element to CABAC and stores the encoded data in the buffer. The predictive coding section includes a subtractor, an orthogonal transform section, a quantizer, an inverse quantizer, an inverse orthogonal transform section, a frame memory, and a motion compensator. The arithmetic coding section includes a binarizer, a binarizer buffer, a context calculator, and a binary arithmetic coding section. The quantizer of the predictive coding section is coupled to a rate control section for controlling the quantization scale of the quantizer. Information about the buffer occupancy of the buffer and information about the buffer occupancy of the binarizer buffer are supplied to the rate control section. The binarizer of the arithmetic coding section binarizes multivalued syntax elements to generate a variable-length binarized symbol sequence. The binarizer cumulatively adds the amounts of binary data in the binarized symbol sequence in the unit of a macroblock. A code amount prediction section is coupled to the binarizer of the arithmetic coding section so that a cumulative addition result produced by the binarizer is supplied to the code amount prediction section. The code amount prediction section calculates a predicted value of the bit amount of encoded data in the buffer from the cumulative total of the amounts of binary data by using a predetermined prediction function and supplies the predicted value to the quantizer of the predictive coding section for the purpose of controlling the quantization scale of the quantizer. In a related-art video encoder that performs an encoding process on a video input signal in real time, a huge amount of computation is required for a process performed by the arithmetic coding section. Therefore, the configuration of the arithmetic coding section is complicated to increase a circuit scale and power consumption. Japanese Unexamined Patent Application Publication No. 2009-055384 states that the use of a prediction function makes it possible to simplify the configuration and decrease the circuit scale and power consumption.
FIG. 1 of Japanese Unexamined Patent Application Publication No. 2007-158430 illustrates a video encoder that performs a variable-length coding process based on context-adaptive binary arithmetic coding (CABAC). In order to provide highly responsive rate control, video data that is not subjected to arithmetic coding is supplied to a code amount estimation section. The estimated code amount generated from the code amount estimation section is supplied to a rate control determination section for the purpose of controlling the quantization step of a quantizer. Japanese Unexamined Patent Application Publication No. 2007-158430 states that, for example, the video data not subjected to arithmetic coding may be a residual signal from a prediction processing section, a DCT coefficient from a DCT section, a quantized coefficient from the quantizer, or binary data from a CABAC section.
Japanese Unexamined Patent Application Publication No. 2009-038746 describes a technology that is based on context-adaptive binary arithmetic coding (CABAC) and used to provide rate control in accordance with an estimated code amount in such a manner as to minimize the error between the estimated code amount and an actual code amount for the purpose of preventing the failure of rate control that is caused by delay in encoding amount acquisition. As such being the case, a video encoder shown in FIG. 10 of Japanese Unexamined Patent Application Publication No. 2009-038746 includes a video compression section, a CABAC section, a code amount estimation section, an estimated code amount substitution section, and a rate control determination section. An input video signal is supplied to the video compression section, which includes a quantizer. An output signal from the video compression section is supplied to the CABAC section, which includes a binarizer and an arithmetic coding section. An output signal from the binarizer of the CABAC section is supplied to an input terminal of the code amount estimation section. Estimated code amounts from the code amount estimation section are cumulatively added by a cumulative estimated code amount calculator in the estimated code amount substitution section. Actual code amounts, which are bit amounts of an encoded stream that is variable-length encoded by the arithmetic coding section of the CABAC section, are cumulatively added by a cumulative code amount calculator in the estimated code amount substitution section. In the estimated code amount substitution section, a cumulative estimated code amount of the cumulative estimated code amount calculator is substituted by a cumulative actual code amount of the cumulative code amount calculator. An output signal from the estimated code amount substitution section is supplied to the rate control determination section. An output signal from the rate control determination section controls the quantization step of the quantizer in the video compression section.